package project_2;

import java.lang.reflect.Array;

public class PGO_host {

	/**
	 * @param args
	 */
	
	static Runnable r = new Runnable() {
		  public void run() {
		    try {
		      while (true) {
		        Thread.sleep(2000L);
		        System.out.println("Hello, world!");
		      }
		    } catch (Exception iex) {
		      System.err.println("Message printer interrupted");
		    }
		  }
		};

	public static void main(String[] args) throws Exception {
		// TODO Auto-generated method stub
		System.out.println("Hello world!");
		for (String s: args){
			System.out.println(s);
		}
		
		PGO_node node1 = new PGO_node(new int[]{2,3});
		PGO_node node2 = new PGO_node(new int[]{1,0});
		Thread thread1 = new Thread(node1);
		Thread thread2 = new Thread(node2);
		
		thread1.start();
		thread2.start();
		
		try{
			Thread.sleep(1000L);
			node1.stop = true;
			System.out.println("Good");
			Thread.sleep(1500L);
			node2.stop = true;
			
		}catch (Exception ex){
			System.out.println("Bad");
		}
		
		//Thread thr = new Thread(r);
		//thr.start();

	}

}
